package com.hainatong.jcmvvmbase.mainhome.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.hainatong.jcmvvmbase.R;
import com.hainatong.jcmvvmbase.databinding.ItemMessageListBinding;
import com.hainatong.jcmvvmbase.mainhome.entity.PlatfromMessage;
import org.jetbrains.annotations.NotNull;

public class MessageAdapter extends BaseQuickAdapter<PlatfromMessage , BaseDataBindingHolder<ItemMessageListBinding>>
{
    public MessageAdapter()
    {
        super(R.layout.item_message_list);
    }

    @Override
    protected void convert(@NotNull BaseDataBindingHolder<ItemMessageListBinding> dataBindingHolder, PlatfromMessage platfromMessage)
    {
        ItemMessageListBinding binding  =  dataBindingHolder.getDataBinding();

        if( binding != null )
        {
            binding.setPlatfrommsg( platfromMessage );
            binding.executePendingBindings();
        }
    }
}
